using namespace std;
#include <vector>

class Solution
{
public:
    int hammingDistance(int x, int y)
    {
        int r = x^y;
        int count = 0;
        while(r)
        {
            r &= r-1;
            count++;
        }
        return count;
    }
};